﻿package Cain.Bit
{
	import Cain.Bit.Bit;
	import flash.events.Event;
	
	/**
	 * 氣球模式 v1.0
	 * @author Cain
	 */
	public class Balloon extends Bit 
	{
		/**
		 * 氣球模式飄動
		 * @param	_name 物件Class名
		 * @param	_g 上浮力
		 * @param	_a 上浮速率
		 * @param	_live 壽命
		 */
		public function Balloon(_name:String,_g:Number=1,_a:Number=1,_live:uint=300) 
		{
			super(_name, _a, 0, _live, -_g);
			setup();
		}
		
		private function setup():void
		{
			addEventListener(Event.ADDED_TO_STAGE, addThis);
		}
		
		private function addThis(e:Event):void 
		{
			removeEventListener(Event.ADDED_TO_STAGE, addThis);
			addEventListener(Event.REMOVED_FROM_STAGE, removethis);
			init();
		}
		
		private function init():void
		{
			
		}
		
		private function removethis(e:Event):void 
		{
			removeEventListener(Event.REMOVED_FROM_STAGE, removethis);
			
		}
	}
	
}